<style>
.fb_button_medium, .fb_button_medium_rtl{height: 22px;}
.fb_button .fb_button_text, .fb_button_rtl .fb_button_text {
    background: url("http://static.ak.fbcdn.net/rsrc.php/v2/yL/r/FGFbc80dUKj.png") repeat scroll 0 0 #5F78AB!important;
    border-bottom: 1px solid #1A356E!important;
    border-top: 1px solid #879AC0!important;
    color: #FFFFFF!important;
    display: block!important;
    font-family: "lucida grande",tahoma,verdana,arial,sans-serif!important;
    font-weight: bold!important;
    margin: 0 1px 0 21px!important;
    padding: 0!important;
    text-shadow: none!important;
}
</style>

<div class="login_main">
<div class="yourAccMain">
<?php echo $form->create('User', array('action'=>"login", 'id'=>'LoginForm')) ?>
     <div class="login_main_left">
    <h6>Registerd customer</h6>
    <br/>
    <span>
     <?php
			echo $this->Session->flash('auth');
	 ?>
     If you have an account with us, please log in.
    
    </span> <br>
    <p>Email Address <br>
      <input type="email" placeholder="me@example.com"  autocomplete="off" required="required" class="fie1" name="data[User][username]">
    </p>
    <br>
    <p>Password <br>
      <?php echo $this->Form->input('User.password',array('type' => 'password','autocomplete'=>'off', 'required'=>true,'class'=>'fie1','label'=>false));?>
    </p>
    <div class="clear"></div>
    <p>
    
    <input type="checkbox" name="data[User][remember_me]"  />Remember me
    </p>
     <p>
    
    <?php echo $this->Html->link('Forget Password', array('controller'=>'users', 'action'=>'forgetpassword'), array('style'=>'color:#3B3B3B')); ?>
    </p>
    <input type="submit" class="sea_btn" value="Login" name="">
    <div class="clear"></div>
    <h2 style="text-align:center;margin: 20px;">OR</h2>
    <div class="clear"></div>
    <div class="facebookLogin" style="text-align:center; float:left;">
     <?php  echo $facebook->login(
				array(
                'perms' => 'email,read_stream,publish_stream','background' => '',
                ));?>
    </div>
  </div>
  <?php echo $form->end(); ?>
  
<?php echo $form->create('User', array('action'=>'signup', 'id'=>'signupLoginForm')) ; 
	if(isset($user['User']['provider']) and $user['User']['provider'])
		{
			$user['User']['provider'] = $user['User']['provider'];
		}
	else
		{
			$user['User']['provider'] = "";
		}
	if(isset($user['User']['provider_id']) and  !$user['User']['provider_id'])
		{
			$user['User']['provider_id'] = $user['User']['provider_id'];
		}
	else
		{
			$user['User']['provider_id'] = "";
		}
		
		
		
	if(isset($user['User']['provider_profile_image']) and  !$user['User']['provider_profile_image'])
		{
			$user['User']['provider_profile_image'] = $user['User']['provider_profile_image'];
		}
	else
		{
			$user['User']['provider_profile_image'] = "";
		}
	if(isset($user['User']['img']) and  !$user['User']['img'])
		{
			$user['User']['img'] = $user['User']['img'];
		}
	else
		{
			$user['User']['img'] = "";
		}
	if(isset($user['User']['about']) and  !$user['User']['about'])
		{
			$user['User']['about'] = $user['User']['about'];
		}
	else
		{
			$user['User']['about'] = "";
		}
	if(isset($user['User']['email']) and  !$user['User']['email'])
		{
			$user['User']['email'] = $user['User']['email'];
		}
	else
		{
			$user['User']['email'] = "";
		}
		
	echo $this->Form->input('User.provider',array('type' => 'hidden', 'value'=>$user['User']['provider'], 'class'=>'fie1','label'=>false));
	echo $this->Form->input('User.provider_id',array('type' => 'hidden', 'value'=>$user['User']['provider_id'], 'class'=>'fie1','label'=>false));
	echo $this->Form->input('User.provider_profile_image',array('type' => 'hidden','value'=>$user['User']['provider_profile_image'], 
							'class'=>'fie1','label'=>false));
	echo $this->Form->input('User.img',array('type' => 'hidden','value'=>$user['User']['img'], 'class'=>'fie1','label'=>false));
	echo $this->Form->input('User.about',array('type' => 'hidden','value'=>$user['User']['about'], 'class'=>'fie1','label'=>false));?>
  <div class="login_main_right">
    <h6>New to Wondere?</h6>
    <br>
    <p>Complete Your Registration</p>
    <p>First Name<br>
    <?php 
			if(isset($user['User']['name']) and ($user['User']['name']))
			{
				$name_exp = explode(' ', $user['User']['name']);
				if(isset($name_exp[0]) and ($name_exp[0]))
					{
						$firstname =  $name_exp[0]; 
						if(isset($name_exp[1]) and ($name_exp[1]))
							{
								$last_name = $name_exp[1]; 
							}
							else
							{
								$last_name = "";
							}
					}
				else{
						$firstname = "";
				}
			}
			else
			{
				$firstname = "";
				$last_name = "";
			}
	?>
       <?php echo $this->Form->input('User.first_name',array('type' => 'text', 'required'=>true, 'value'=>$firstname ,  'class'=>'fie1','label'=>false));?>
    </p>
    <p>Last Name<br>
       <?php echo $this->Form->input('User.last_name',array('type' => 'text', 'required'=>true, 'value'=>$last_name , 'class'=>'fie1','label'=>false));?>
    </p>

    <p> E-mail address<br>
      <input type="email" placeholder="Enter Email"  required="required email" value="<?php echo $user['User']['email']; ?>"  class="fie1" name="data[User][username]">
	  <?php //echo $this->Form->input('User.email',array('type' => 'text', 'required'=>true, 'class'=>'fie1','label'=>false));?>

    </p>
    <p> Password<br>
       <?php echo $this->Form->input('User.password',array('type' => 'password','required'=>true,'class'=>'fie1','label'=>false));?>
    </p>
    <p> Re-enter your Password<br>
        <?php echo $this->Form->input('User.confirm_password',array('type' => 'password','required'=>true,'class'=>'fie1','label'=>false));?>
    </p>
    <p> Security Code<br>
     2+8 =
       <?php echo $this->Form->input('User.captcha_code',array('type' => 'text','required'=>true,'class'=>'fie1','label'=>false));?>
        <img id="captcha" src="<?php echo $html->url('/users/captcha_image');?>" alt="" />
       
        <!--<a href="javascript:void(0);" 
        onclick="javascript:document.images.captcha.src='<?php //echo $html->url('/users/captcha_image');?>/' + Math.round(Math.random(0)*1000)+1">
        Reload image</a> -->
   </p>
    <p>
    <input type="checkbox" value="1" name="data[User][conditions_agree]" required="required">
        <a href="http://wondere.com/terms" target="_blank" style="color:#3B3B3B; text-decoration:none;">I accept all terms and conditions.</a></p>
    <input type="submit" class="sea_btn" value="join free" name="Register">
  </div>
  <?php echo $form->end(); ?>
</div>  
</div>
